var username = document.getElementById('username');
var pwd = document.getElementById('pwd');
var rpwd = document.getElementById('rpwd');
var age = document.getElementById('age');
var color = document.getElementById('color');
var introduce = document.getElementById('introduce');

function check(){
    if(username.value.length<6 || username.value.length>20){
        alert("请按规定输入用户名");
        return false;
    }
    if(pwd.value.length<6 || pwd.value.length>20){
        alert("请按规定输入密码");
        return false;
    }else if(pwd.value != rpwd.value){
        alert("两次输入的密码不一致");
        return false;
    }
    if(age.value.length<0 || age.value.length>3){
        alert("请按规定输入年龄");
        return false;
    }
    if(introduce.value.length == 0){
        alert("请按规定输入个人介绍");
        return false;
    }
    return true;
}